// fabu/fabuCom/dateCom/datePicker.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    key:{
      type:String,
      value:'开课时间'
    },
    mode:{
      type:String,
      value:'date'
    },   
    xingStyle: {
      type: String
    },
    xing: {
      type: String,
      value: '*'
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    date:'2019-01-01'
  },
  attached:function(e)
  {
    var timestamp = Date.parse(new Date());
    var date = new Date(timestamp);
    //年  
    var Y = date.getFullYear();
    //月  
    var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
    //日  
    var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();
    this.setData({
      date:Y+'-'+M+'-'+D
    })
   
    
  },
  /**
   * 组件的方法列表
   */
  methods: {
    changeDate:function(e)
   {
     console.log(e)
     this.setData({
       date:e.detail.value
     })
     var value=e.detail.value
     this.triggerEvent('overDate',{value})
   }
  }
})
